﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BotDetector.Core.Search
{
    public class GoogleSearchConfigurator
    {
        private static Dictionary<string, string> languages = new Dictionary<string, string>();
        private static Dictionary<string, string> countries = new Dictionary<string, string>();

        public Dictionary<string, string> Languages
        {
            get { return languages; }
        }

        public Dictionary<string, string> Countries
        {
            get { return countries; }
        }

        
        static GoogleSearchConfigurator()
        {
            InitializeCountries();
            InitializeLanguages();
        }

        private static void InitializeLanguages()
        {
            languages.Add("Arabic", "lang_ar");
            languages.Add("Bulgarian", "lang_bg");
            languages.Add("Catalan", "lang_ca");
            languages.Add("Czech", "lang_cs");
            languages.Add("Danish", "lang_da");
            languages.Add("German", "lang_de");
            languages.Add("Greek", "lang_el");
            languages.Add("English", "lang_en");
            languages.Add("Spanish", "lang_es");
            languages.Add("Estonian", "lang_et");
            languages.Add("Finnish", "lang_fi");
            languages.Add("French", "lang_fr");
            languages.Add("Croatian", "lang_hr");
            languages.Add("Hungarian", "lang_hu");
            languages.Add("Indonesian", "lang_id");
            languages.Add("Icelandic", "lang_is");
            languages.Add("Italian", "lang_it");
            languages.Add("Hebrew", "lang_iw");
            languages.Add("Japanese", "lang_ja");
            languages.Add("Korean", "lang_ko");
            languages.Add("Lithuanian", "lang_lt");
            languages.Add("Latvian", "lang_lv");
            languages.Add("Dutch", "lang_nl");
            languages.Add("Norwegian", "lang_no");
            languages.Add("Polish", "lang_pl");
            languages.Add("Portuguese", "lang_pt");
            languages.Add("Romanian", "lang_ro");
            languages.Add("Russian", "lang_ru");
            languages.Add("Slovak", "lang_sk");
            languages.Add("Slovenian", "lang_sl");
            languages.Add("Serbian", "lang_sr");
            languages.Add("Swedish", "lang_sv");
            languages.Add("Turkish", "lang_tr");
            languages.Add("ChineseSimplified", "lang_zh-CN");
            languages.Add("ChineseTraditional", "lang_zh-TW");
        }

        private static void InitializeCountries()
        {
            countries.Add("Austria", "countryAT");
            countries.Add("Belgium", "countryBE");
            countries.Add("Bulgaria", "countryBG");
            countries.Add("Canada", "countryCA");
            countries.Add("Denmark", "countryDK");
            countries.Add("European Union", "countryEU");
            countries.Add("France", "countryFR");
            countries.Add("Germany", "countryDE");
            countries.Add("India", "countryIN");
            countries.Add("Italy", "countryIT");
            countries.Add("Japan", "countryJP");
            countries.Add("Portugal", "countryPT");
            countries.Add("Poland", "countryPL");
            countries.Add("Romania", "countryRO");
            countries.Add("Russia", "countryRU");
            countries.Add("Spain", "countryES");
            countries.Add("United Kingdom", "countryUK");
            countries.Add("United States", "countryUS");
        }
    }
}
